﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DTO;
using Persistence;

namespace BusinessLogic
{
    public class PersonBL
    {

        public static long validateUser(string vUser, string vPass)
        {
            return PersonController.validateUser(vUser, vPass);
        }

        public static String getRoleById(long vId)
        {
            return PersonController.getRoleById(vId);
        }

        public static Person getPersonById(long vId)
        {
            string role = getRoleById(vId);
            Person p = null;
            if (role.Equals("Administrator"))
            {
                p = AdministratorController.getAdministratorById(vId);
            }
            else if (role.Equals("Teacher"))
            {
                p = TeacherController.getTeacherById(vId);
            }
            else
            {
                p = StudentController.getStudentById(vId);
            }
            return p;
        }
    }
}
